<template>
	<view>
		<button @click="openDialog" v-bind="buttonConfig">{{name}}</button>
		<uni-popup ref="dialog" v-bind="dialogConfig">
			<slot></slot>
		</uni-popup>
	</view>
</template>

<script>
	export default {
		name: "OpenDialog",
		props: ["buttonConfig", "name", "dialogConfig"],
		methods: {
			/**
			 * 打开弹窗
			 */
			openDialog() {
				this.$refs.dialog.open()
			}
		}
	}
</script>

<style>
</style>
